package com.chen.controller;

import com.chen.service.PublisherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pub")
public class PublisherController {
    @Autowired
    private PublisherService publisherService;

    @GetMapping("/{message}")
    public String pushMsg(@PathVariable("message") String message){
        return publisherService.pushMsg(message);
    }
}
